/*! For license information please see typesense-instantsearch-adapter.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TypesenseInstantSearchAdapter=e():t.TypesenseInstantSearchAdapter=e()}(self,(()=>(()=>{var t={9669:(t,e,n)=>{t.exports=n(1609)},5448:(t,e,n)=>{"use strict";var r=n(4867),o=n(6026),i=n(4372),a=n(5327),s=n(4097),u=n(4109),c=n(7985),l=n(5061),f=n(7874),h=n(5263);t.exports=function(t){return new Promise((function(e,n){var p,d=t.data,y=t.headers,v=t.responseType;function g(){t.cancelToken&&t.cancelToken.unsubscribe(p),t.signal&&t.signal.removeEventListener("abort",p)}r.isFormData(d)&&delete y["Content-Type"];var b=new XMLHttpRequest;if(t.auth){var m=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(m+":"+_)}var w=s(t.baseURL,t.url);function P(){if(b){var r="getAllResponseHeaders"in b?u(b.getAllResponseHeaders()):null,i={data:v&&"text"!==v&&"json"!==v?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:t,request:b};o((function(t){e(t),g()}),(function(t){n(t),g()}),i),b=null}}if(b.open(t.method.toUpperCase(),a(w,t.params,t.paramsSerializer),!0),b.timeout=t.timeout,"onloadend"in b?b.onloadend=P:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(P)},b.onabort=function(){b&&(n(l("Request aborted",t,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",t,null,b)),b=null},b.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||f;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(l(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var S=(t.withCredentials||c(w))&&t.xsrfCookieName?i.read(t.xsrfCookieName):void 0;S&&(y[t.xsrfHeaderName]=S)}"setRequestHeader"in b&&r.forEach(y,(function(t,e){void 0===d&&"content-type"===e.toLowerCase()?delete y[e]:b.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(b.withCredentials=!!t.withCredentials),v&&"json"!==v&&(b.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&b.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(p=function(t){b&&(n(!t||t&&t.type?new h("canceled"):t),b.abort(),b=null)},t.cancelToken&&t.cancelToken.subscribe(p),t.signal&&(t.signal.aborted?p():t.signal.addEventListener("abort",p))),d||(d=null),b.send(d)}))}},1609:(t,e,n)=>{"use strict";var r=n(4867),o=n(1849),i=n(321),a=n(7185),s=function t(e){var n=new i(e),s=o(i.prototype.request,n);return r.extend(s,i.prototype,n),r.extend(s,n),s.create=function(n){return t(a(e,n))},s}(n(5546));s.Axios=i,s.Cancel=n(5263),s.CancelToken=n(4972),s.isCancel=n(6502),s.VERSION=n(7288).version,s.all=function(t){return Promise.all(t)},s.spread=n(8713),s.isAxiosError=n(6268),t.exports=s,t.exports.default=s},5263:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},4972:(t,e,n)=>{"use strict";var r=n(5263);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e<r;e++)n._listeners[e](t);n._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},o.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},6502:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,n)=>{"use strict";var r=n(4867),o=n(5327),i=n(782),a=n(3572),s=n(7185),u=n(4875),c=u.validators;function l(t){this.defaults=t,this.interceptors={request:new i,response:new i}}l.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&u.assertOptions(n,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(o=o&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,l=[];if(this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)})),!o){var f=[a,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(l),i=Promise.resolve(e);f.length;)i=i.then(f.shift(),f.shift());return i}for(var h=e;r.length;){var p=r.shift(),d=r.shift();try{h=p(h)}catch(t){d(t);break}}try{i=a(h)}catch(t){return Promise.reject(t)}for(;l.length;)i=i.then(l.shift(),l.shift());return i},l.prototype.getUri=function(t){return t=s(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(s(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(s(r||{},{method:t,url:e,data:n}))}})),t.exports=l},782:(t,e,n)=>{"use strict";var r=n(4867);function o(){this.handlers=[]}o.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},4097:(t,e,n)=>{"use strict";var r=n(1793),o=n(7303);t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},5061:(t,e,n)=>{"use strict";var r=n(481);t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},3572:(t,e,n)=>{"use strict";var r=n(4867),o=n(8527),i=n(6502),a=n(5546),s=n(5263);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new s("canceled")}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=o.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return u(t),e.data=o.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(u(t),e&&e.response&&(e.response.data=o.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},481:t=>{"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},7185:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){e=e||{};var n={};function o(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function i(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:o(void 0,t[n]):o(t[n],e[n])}function a(t){if(!r.isUndefined(e[t]))return o(void 0,e[t])}function s(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:o(void 0,t[n]):o(void 0,e[n])}function u(n){return n in e?o(t[n],e[n]):n in t?o(void 0,t[n]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||i,o=e(t);r.isUndefined(o)&&e!==u||(n[t]=o)})),n}},6026:(t,e,n)=>{"use strict";var r=n(5061);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},8527:(t,e,n)=>{"use strict";var r=n(4867),o=n(5546);t.exports=function(t,e,n){var i=this||o;return r.forEach(n,(function(n){t=n.call(i,t,e)})),t}},5546:(t,e,n)=>{"use strict";var r=n(4867),o=n(6016),i=n(481),a=n(7874),s={"Content-Type":"application/x-www-form-urlencoded"};function u(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var c,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(c=n(5448)),c),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(u(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(u(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(0,JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||l.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(a){if("SyntaxError"===t.name)throw i(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){l.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){l.headers[t]=r.merge(s)})),t.exports=l},7874:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:t=>{t.exports={version:"0.26.1"}},1849:t=>{"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},5327:(t,e,n)=>{"use strict";var r=n(4867);function o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))})))})),i=a.join("&")}if(i){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},7303:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},6268:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},7985:(t,e,n)=>{"use strict";var r=n(4867);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},6016:(t,e,n)=>{"use strict";var r=n(4867);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},4109:(t,e,n)=>{"use strict";var r=n(4867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},8713:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},4875:(t,e,n)=>{"use strict";var r=n(7288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){o[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var i={};o.transitional=function(t,e,n){function o(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,a){if(!1===t)throw new Error(o(r," has been removed"+(e?" in "+e:"")));return e&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,a)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var r=Object.keys(t),o=r.length;o-- >0;){var i=r[o],a=e[i];if(a){var s=t[i],u=void 0===s||a(s,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},4867:(t,e,n)=>{"use strict";var r=n(1849),o=Object.prototype.toString;function i(t){return Array.isArray(t)}function a(t){return void 0===t}function s(t){return"[object ArrayBuffer]"===o.call(t)}function u(t){return null!==t&&"object"==typeof t}function c(t){if("[object Object]"!==o.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function l(t){return"[object Function]"===o.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:s,isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"[object FormData]"===o.call(t)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&s(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isPlainObject:c,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:l,isStream:function(t){return u(t)&&l(t.pipe)},isURLSearchParams:function(t){return"[object URLSearchParams]"===o.call(t)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:f,merge:function t(){var e={};function n(n,r){c(e[r])&&c(n)?e[r]=t(e[r],n):c(n)?e[r]=t({},n):i(n)?e[r]=n.slice():e[r]=n}for(var r=0,o=arguments.length;r<o;r++)f(arguments[r],n);return e},extend:function(t,e,n){return f(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},2043:function(t,e,n){var r,o;!function(i,a){"use strict";r=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function o(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(e,n){for(var o=0;o<r.length;o++){var i=r[o];this[i]=o<e?t:this.methodFactory(i,e,n)}this.log=this.debug}function s(t,n,r){return function(){typeof console!==e&&(a.call(this,n,r),this[t].apply(this,arguments))}}function u(r,a,u){return function(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?i:void 0!==console[r]?o(console,r):void 0!==console.log?o(console,"log"):t)}(r)||s.apply(this,arguments)}function c(t,n,o){var i,s=this;n=null==n?"WARN":n;var c="loglevel";function l(){var t;if(typeof window!==e&&c){try{t=window.localStorage[c]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=n.indexOf(encodeURIComponent(c)+"=");-1!==r&&(t=/^([^;]+)/.exec(n.slice(r))[1])}catch(t){}return void 0===s.levels[t]&&(t=void 0),t}}"string"==typeof t?c+=":"+t:"symbol"==typeof t&&(c=void 0),s.name=t,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=o||u,s.getLevel=function(){return i},s.setLevel=function(n,o){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==o&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&c){try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}}(n),a.call(s,n,t),typeof console===e&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(t){n=t,l()||s.setLevel(t,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==e&&c){try{return void window.localStorage.removeItem(c)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}()},s.enableAll=function(t){s.setLevel(s.levels.TRACE,t)},s.disableAll=function(t){s.setLevel(s.levels.SILENT,t)};var f=l();null==f&&(f=n),s.setLevel(f,!1)}var l=new c,f={};l.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=f[t];return e||(e=f[t]=new c(t,l.getLevel(),l.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return l.noConflict=function(){return typeof window!==e&&window.log===l&&(window.log=h),l},l.getLoggers=function(){return f},l.default=l,l},void 0===(o=r.call(e,n,e,t))||(t.exports=o)}()},8871:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.SearchClient=e.Client=void 0;var s=a(n(4339));e.Client=s.default;var u=a(n(8834));e.SearchClient=u.default;var c=i(n(6718));e.Errors=c,e.default={Client:s.default,SearchClient:u.default,Errors:c}},8480:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(5346)),s=function(){function t(t,e){this.name=t,this.apiCall=e}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.name)},t}();e.default=s},5346:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o="/aliases",i=function(){function t(t){this.apiCall=t}return t.prototype.upsert=function(t,e){return n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.apiCall.put(this.endpointPath(t),e)]}))}))},t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get(o)]}))}))},t.prototype.endpointPath=function(e){return"".concat(t.RESOURCEPATH,"/").concat(e)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return o},enumerable:!1,configurable:!0}),t}();e.default=i},6845:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(9034)),i=r(n(7533)),a=function(){function t(t){this.apiCall=t,this.individualAnalyticsRules={},this.apiCall=t,this._analyticsRules=new o.default(this.apiCall)}return t.prototype.rules=function(t){return void 0===t?this._analyticsRules:(void 0===this.individualAnalyticsRules[t]&&(this.individualAnalyticsRules[t]=new i.default(t,this.apiCall)),this.individualAnalyticsRules[t])},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return"/analytics"},enumerable:!1,configurable:!0}),t}();e.default=a},7533:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(9034)),s=function(){function t(t,e){this.name=t,this.apiCall=e}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.name)},t}();e.default=s},9034:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t,this.apiCall=t}return t.prototype.upsert=function(t,e){return n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.apiCall.put(this.endpointPath(t),e)]}))}))},t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.endpointPath=function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return"/analytics/rules"},enumerable:!1,configurable:!0}),t}();e.default=o},9777:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(9669)),s=n(6718),u=i(n(4492)),c=!0,l=function(){function t(t){this.configuration=t,this.apiKey=this.configuration.apiKey,this.nodes=null==this.configuration.nodes?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=null==this.configuration.nearestNode?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return t.prototype.get=function(t,e,n){void 0===e&&(e={});var i=void 0===n?{}:n,a=i.abortSignal,s=void 0===a?null:a,u=i.responseType,c=void 0===u?void 0:u;return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.performRequest("get",t,{queryParameters:e,abortSignal:s,responseType:c})]}))}))},t.prototype.delete=function(t,e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.performRequest("delete",t,{queryParameters:e})]}))}))},t.prototype.post=function(t,e,n,i){return void 0===e&&(e={}),void 0===n&&(n={}),void 0===i&&(i={}),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.performRequest("post",t,{queryParameters:n,bodyParameters:e,additionalHeaders:i})]}))}))},t.prototype.put=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.performRequest("put",t,{queryParameters:n,bodyParameters:e})]}))}))},t.prototype.patch=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),r(this,void 0,void 0,(function(){return o(this,(function(r){return[2,this.performRequest("patch",t,{queryParameters:n,bodyParameters:e})]}))}))},t.prototype.performRequest=function(t,e,n){var i,s,u,l=n.queryParameters,f=void 0===l?null:l,h=n.bodyParameters,p=void 0===h?null:h,d=n.additionalHeaders,y=void 0===d?{}:d,v=n.abortSignal,g=void 0===v?null:v,b=n.responseType,m=void 0===b?void 0:b,_=n.skipConnectionTimeout,w=void 0!==_&&_;return r(this,void 0,void 0,(function(){var n,r,l,h,d,v;return o(this,(function(b){switch(b.label){case 0:this.configuration.validate(),n=Date.now(),this.logger.debug("Request #".concat(n,": Performing ").concat(t.toUpperCase()," request: ").concat(e)),l=function(l){var d,v,b,_,P,S,O;return o(this,(function(o){switch(o.label){case 0:if(d=h.getNextNode(n),h.logger.debug("Request #".concat(n,": Attempting ").concat(t.toUpperCase()," request Try #").concat(l," to Node ").concat(d.index)),g&&g.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];v=void 0,o.label=1;case 1:return o.trys.push([1,3,5,6]),b={method:t,url:h.uriFor(e,d),headers:Object.assign({},h.defaultHeaders(),y,h.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,responseType:m,validateStatus:function(t){return t>0},transformResponse:[function(t,e){var n=t;return void 0!==e&&"string"==typeof t&&e["content-type"]&&e["content-type"].startsWith("application/json")&&(n=JSON.parse(t)),n}]},!0!==w&&(b.timeout=1e3*h.connectionTimeoutSeconds),f&&0!==Object.keys(f).length&&(b.params=f),h.sendApiKeyAsQueryParam&&(b.params=b.params||{},b.params["x-typesense-api-key"]=h.apiKey),p&&("string"==typeof p&&0!==p.length||"object"==typeof p&&0!==Object.keys(p).length)&&(b.data=p),g&&(_=a.default.CancelToken,P=_.source(),v=function(){return P.cancel()},g.addEventListener("abort",v),b.cancelToken=P.token),[4,(0,a.default)(b)];case 2:if((S=o.sent()).status>=1&&S.status<=499&&h.setNodeHealthcheck(d,c),h.logger.debug("Request #".concat(n,": Request to Node ").concat(d.index," was made. Response Code was ").concat(S.status,".")),S.status>=200&&S.status<300)return[2,{value:Promise.resolve(S.data)}];if(S.status<500)return[2,{value:Promise.reject(h.customErrorForResponse(S,null===(i=S.data)||void 0===i?void 0:i.message))}];throw h.customErrorForResponse(S,null===(s=S.data)||void 0===s?void 0:s.message);case 3:return O=o.sent(),h.setNodeHealthcheck(d,!1),r=O,h.logger.warn("Request #".concat(n,": Request to Node ").concat(d.index,' failed due to "').concat(O.code," ").concat(O.message).concat(null==O.response?"":" - "+JSON.stringify(null===(u=O.response)||void 0===u?void 0:u.data),'"')),h.logger.warn("Request #".concat(n,": Sleeping for ").concat(h.retryIntervalSeconds,"s and then retrying request...")),[4,h.timer(h.retryIntervalSeconds)];case 4:return o.sent(),[3,6];case 5:return g&&v&&g.removeEventListener("abort",v),[7];case 6:return[2]}}))},h=this,d=1,b.label=1;case 1:return d<=this.numRetriesPerRequest+1?[5,l(d)]:[3,4];case 2:if("object"==typeof(v=b.sent()))return[2,v.value];b.label=3;case 3:return d++,[3,1];case 4:return this.logger.debug("Request #".concat(n,": No retries left. Raising last error")),[2,Promise.reject(r)]}}))}))},t.prototype.getNextNode=function(t){if(void 0===t&&(t=0),null!=this.nearestNode){if(this.logger.debug("Request #".concat(t,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(!0===this.nearestNode.isHealthy?"Healthy":"Unhealthy")),!0===this.nearestNode.isHealthy||this.nodeDueForHealthcheck(this.nearestNode,t))return this.logger.debug("Request #".concat(t,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(t,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(t,": Nodes Health: ").concat(this.nodes.map((function(t){return"Node ".concat(t.index," is ").concat(!0===t.isHealthy?"Healthy":"Unhealthy")})).join(" || ")));for(var e=this.nodes[0],n=0;n<=this.nodes.length;n++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,!0===(e=this.nodes[this.currentNodeIndex]).isHealthy||this.nodeDueForHealthcheck(e,t))return this.logger.debug("Request #".concat(t,": Updated current node to Node ").concat(e.index)),e;return this.logger.debug("Request #".concat(t,": No healthy nodes were found. Returning the next node, Node ").concat(e.index)),e},t.prototype.nodeDueForHealthcheck=function(t,e){void 0===e&&(e=0);var n=Date.now()-t.lastAccessTimestamp>1e3*this.healthcheckIntervalSeconds;return n&&this.logger.debug("Request #".concat(e,": Node ").concat(t.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),n},t.prototype.initializeMetadataForNodes=function(){var t=this;null!=this.nearestNode&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,c)),this.nodes.forEach((function(e,n){e.index=n,t.setNodeHealthcheck(e,c)}))},t.prototype.setNodeHealthcheck=function(t,e){t.isHealthy=e,t.lastAccessTimestamp=Date.now()},t.prototype.uriFor=function(t,e){return null!=e.url?"".concat(e.url).concat(t):"".concat(e.protocol,"://").concat(e.host,":").concat(e.port).concat(e.path).concat(t)},t.prototype.defaultHeaders=function(){var t={};return this.sendApiKeyAsQueryParam||(t["X-TYPESENSE-API-KEY"]=this.apiKey),t["Content-Type"]="application/json",t},t.prototype.timer=function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new Promise((function(e){return setTimeout(e,1e3*t)}))]}))}))},t.prototype.customErrorForResponse=function(t,e){var n="Request failed with HTTP code ".concat(t.status);"string"==typeof e&&""!==e.trim()&&(n+=" | Server said: ".concat(e));var r=new u.default(n);return(r=400===t.status?new s.RequestMalformed(n):401===t.status?new s.RequestUnauthorized(n):404===t.status?new s.ObjectNotFound(n):409===t.status?new s.ObjectAlreadyExists(n):422===t.status?new s.ObjectUnprocessable(n):t.status>=500&&t.status<=599?new s.ServerError(n):new s.HTTPError(n)).httpStatus=t.status,r},t}();e.default=l},4339:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(2554)),i=r(n(9777)),a=r(n(6581)),s=r(n(8243)),u=r(n(5346)),c=r(n(8480)),l=r(n(2708)),f=r(n(7309)),h=r(n(7634)),p=r(n(6029)),d=r(n(1930)),y=r(n(3095)),v=r(n(9092)),g=r(n(1036)),b=r(n(1040)),m=r(n(6845)),_=function(){function t(t){var e;t.sendApiKeyAsQueryParam=null!==(e=t.sendApiKeyAsQueryParam)&&void 0!==e&&e,this.configuration=new o.default(t),this.apiCall=new i.default(this.configuration),this.debug=new h.default(this.apiCall),this.metrics=new p.default(this.apiCall),this.health=new d.default(this.apiCall),this.operations=new y.default(this.apiCall),this.multiSearch=new v.default(this.apiCall,this.configuration),this._collections=new a.default(this.apiCall),this.individualCollections={},this._aliases=new u.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new g.default(this.apiCall),this.individualPresets={},this.analytics=new m.default(this.apiCall)}return t.prototype.collections=function(t){return void 0===t?this._collections:(void 0===this.individualCollections[t]&&(this.individualCollections[t]=new s.default(t,this.apiCall,this.configuration)),this.individualCollections[t])},t.prototype.aliases=function(t){return void 0===t?this._aliases:(void 0===this.individualAliases[t]&&(this.individualAliases[t]=new c.default(t,this.apiCall)),this.individualAliases[t])},t.prototype.keys=function(t){return void 0===t?this._keys:(void 0===this.individualKeys[t]&&(this.individualKeys[t]=new f.default(t,this.apiCall)),this.individualKeys[t])},t.prototype.presets=function(t){return void 0===t?this._presets:(void 0===this.individualPresets[t]&&(this.individualPresets[t]=new b.default(t,this.apiCall)),this.individualPresets[t])},t}();e.default=_},8243:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(6581)),s=i(n(1949)),u=n(6718),c=i(n(6067)),l=i(n(3620)),f=i(n(1940)),h=i(n(1483)),p=n(9071),d=function(){function t(t,e,n){this.name=t,this.apiCall=e,this.configuration=n,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=t,this.apiCall=e,this.configuration=n,this._documents=new s.default(this.name,this.apiCall,this.configuration),this._overrides=new c.default(this.name,this.apiCall),this._synonyms=new f.default(this.name,this.apiCall)}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.update=function(t){return r(this,void 0,void 0,(function(){return o(this,(function(e){return[2,this.apiCall.patch(this.endpointPath(),t)]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.exists=function(){return r(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return e.sent(),[2,!0];case 2:if((t=e.sent())instanceof u.ObjectNotFound)return[2,!1];throw t;case 3:return[2]}}))}))},t.prototype.documents=function(t){return t?(void 0===this.individualDocuments[t]&&(this.individualDocuments[t]=new p.Document(this.name,t,this.apiCall)),this.individualDocuments[t]):this._documents},t.prototype.overrides=function(t){return void 0===t?this._overrides:(void 0===this.individualOverrides[t]&&(this.individualOverrides[t]=new l.default(this.name,t,this.apiCall)),this.individualOverrides[t])},t.prototype.synonyms=function(t){return void 0===t?this._synonyms:(void 0===this.individualSynonyms[t]&&(this.individualSynonyms[t]=new h.default(this.name,t,this.apiCall)),this.individualSynonyms[t])},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.name)},t}();e.default=d},6581:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o="/collections",i=function(){function t(t){this.apiCall=t}return t.prototype.create=function(t,e){return void 0===e&&(e={}),n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.apiCall.post(o,t,e)]}))}))},t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get(o)]}))}))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return o},enumerable:!1,configurable:!0}),t}();e.default=i},2554:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var s=a(n(2043)),u=n(6718),c=function(){function t(t){var e=this;this.nodes=t.nodes||[],this.nodes=this.nodes.map((function(t){return e.setDefaultPathInNode(t)})).map((function(t){return e.setDefaultPortInNode(t)})).map((function(t){return r({},t)})),null==t.randomizeNodes&&(t.randomizeNodes=!0),!0===t.randomizeNodes&&this.shuffleArray(this.nodes),this.nearestNode=t.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=t.connectionTimeoutSeconds||t.timeoutSeconds||5,this.healthcheckIntervalSeconds=t.healthcheckIntervalSeconds||60,this.numRetries=t.numRetries||this.nodes.length+(null==this.nearestNode?0:1)||3,this.retryIntervalSeconds=t.retryIntervalSeconds||.1,this.apiKey=t.apiKey,this.sendApiKeyAsQueryParam=t.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=t.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=t.useServerSideSearchCache||!1,this.logger=t.logger||s,this.logLevel=t.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=t.additionalHeaders,this.showDeprecationWarnings(t),this.validate()}return t.prototype.validate=function(){if(null==this.nodes||0===this.nodes.length||this.validateNodes())throw new u.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(null!=this.nearestNode&&this.isNodeMissingAnyParameters(this.nearestNode))throw new u.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(null==this.apiKey)throw new u.MissingConfigurationError("Ensure that apiKey is set");return!0},t.prototype.validateNodes=function(){var t=this;return this.nodes.some((function(e){return t.isNodeMissingAnyParameters(e)}))},t.prototype.isNodeMissingAnyParameters=function(t){return!["protocol","host","port","path"].every((function(e){return t.hasOwnProperty(e)}))&&null==t.url},t.prototype.setDefaultPathInNode=function(t){return null==t||t.hasOwnProperty("path")||(t.path=""),t},t.prototype.setDefaultPortInNode=function(t){if(null!=t&&!t.hasOwnProperty("port")&&t.hasOwnProperty("protocol"))switch(t.protocol){case"https":t.port=443;break;case"http":t.port=80}return t},t.prototype.showDeprecationWarnings=function(t){t.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),t.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),t.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},t.prototype.shuffleArray=function(t){for(var e,n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1));e=[t[r],t[n]],t[n]=e[0],t[r]=e[1]}},t}();e.default=c},7634:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t}return t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get("/debug")]}))}))},t}();e.default=o},9071:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Document=void 0;var a=i(n(6581)),s=i(n(1949)),u=function(){function t(t,e,n){this.collectionName=t,this.documentId=e,this.apiCall=n}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.update=function(t,e){return void 0===e&&(e={}),r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.apiCall.patch(this.endpointPath(),t,e)]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(s.default.RESOURCEPATH,"/").concat(this.documentId)},t}();e.Document=u},1949:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(6718),u=function(t){function e(e,n,r){return t.call(this,e,n,r)||this}return o(e,t),e.prototype.create=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){return a(this,(function(n){if(!t)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),t,e)]}))}))},e.prototype.upsert=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){return a(this,(function(n){if(!t)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),t,Object.assign({},e,{action:"upsert"}))]}))}))},e.prototype.update=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){return a(this,(function(n){if(!t)throw new Error("No document provided");return null!=e.filter_by?[2,this.apiCall.patch(this.endpointPath(),t,Object.assign({},e))]:[2,this.apiCall.post(this.endpointPath(),t,Object.assign({},e,{action:"update"}))]}))}))},e.prototype.delete=function(t){return void 0===t&&(t={}),i(this,void 0,void 0,(function(){return a(this,(function(e){return"string"==typeof t?[2,this.apiCall.delete(this.endpointPath(t),t)]:[2,this.apiCall.delete(this.endpointPath(),t)]}))}))},e.prototype.createMany=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){return a(this,(function(n){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(t,e)]}))}))},e.prototype.import=function(t,e){return void 0===e&&(e={}),i(this,void 0,void 0,(function(){var n,r,o,i;return a(this,(function(a){switch(a.label){case 0:if(Array.isArray(t))try{n=t.map((function(t){return JSON.stringify(t)})).join("\n")}catch(t){if(RangeError instanceof t&&(null==t?void 0:t.includes("Too many properties to enumerate")))throw new Error("".concat(t,"\n          It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object\n\n          Please try reducing the number of keys in your document, or using CURL to import your data.\n          "));throw new Error(t)}else n=t;return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:e,bodyParameters:n,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:if(r=a.sent(),Array.isArray(t)){if(o=r.split("\n").map((function(t){return JSON.parse(t)})),(i=o.filter((function(t){return!1===t.success}))).length>0)throw new s.ImportError("".concat(o.length-i.length," documents imported successfully, ").concat(i.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),o);return[2,o]}return[2,r]}}))}))},e.prototype.export=function(t){return void 0===t&&(t={}),i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this.apiCall.get(this.endpointPath("export"),t)]}))}))},e.prototype.exportStream=function(t){return void 0===t&&(t={}),i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this.apiCall.get(this.endpointPath("export"),t,{responseType:"stream"})]}))}))},e}(n(5586).SearchOnlyDocuments);e.default=u},7117:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},9229:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.importResults=n,r}return o(e,t),e}(i(n(4492)).default);e.default=a},1254:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},4105:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},3836:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},220:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},4913:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},9976:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},4959:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(i(n(4492)).default);e.default=a},4492:function(t,e){"use strict";var n,r=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.name=n.name,Object.setPrototypeOf(r,n.prototype),r}return r(e,t),e}(Error);e.default=o},6718:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ImportError=e.TypesenseError=e.ServerError=e.RequestUnauthorized=e.RequestMalformed=e.ObjectUnprocessable=e.ObjectNotFound=e.ObjectAlreadyExists=e.MissingConfigurationError=e.HTTPError=void 0;var o=r(n(7117));e.HTTPError=o.default;var i=r(n(1254));e.MissingConfigurationError=i.default;var a=r(n(4105));e.ObjectAlreadyExists=a.default;var s=r(n(3836));e.ObjectNotFound=s.default;var u=r(n(220));e.ObjectUnprocessable=u.default;var c=r(n(4913));e.RequestMalformed=c.default;var l=r(n(9976));e.RequestUnauthorized=l.default;var f=r(n(4959));e.ServerError=f.default;var h=r(n(9229));e.ImportError=h.default;var p=r(n(4492));e.TypesenseError=p.default},1930:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t}return t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get("/health")]}))}))},t}();e.default=o},7309:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(2708)),s=function(){function t(t,e){this.id=t,this.apiCall=e}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.id)},t}();e.default=s},2708:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(9964),a="/keys",s=function(){function t(t){this.apiCall=t,this.apiCall=t}return t.prototype.create=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.apiCall.post(t.RESOURCEPATH,e)]}))}))},t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(a)]}))}))},t.prototype.generateScopedSearchKey=function(t,e){var n=JSON.stringify(e),r=Buffer.from((0,i.createHmac)("sha256",t).update(n).digest("base64")),o=t.substr(0,4),a="".concat(r).concat(o).concat(n);return Buffer.from(a).toString("base64")},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return a},enumerable:!1,configurable:!0}),t}();e.default=s},6029:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t}return t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get("/metrics.json")]}))}))},t}();e.default=o},9092:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(2598)),s=function(){function t(t,e,n){void 0===n&&(n=!1),this.apiCall=t,this.configuration=e,this.useTextContentType=n,this.requestWithCache=new a.default}return t.prototype.clearCache=function(){this.requestWithCache.clearCache()},t.prototype.perform=function(t,e,n){void 0===e&&(e={});var i=(void 0===n?{}:n).cacheSearchResultsForSeconds,a=void 0===i?this.configuration.cacheSearchResultsForSeconds:i;return r(this,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){return n={},this.useTextContentType&&(n["content-type"]="text/plain"),r={},!0===this.configuration.useServerSideSearchCache&&(r.use_cache=!0),i=Object.assign({},e,r),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.post,["/multi_search",t,i,n],{cacheResponseForSeconds:a})]}))}))},t}();e.default=s},3095:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t}return t.prototype.perform=function(t,e){return void 0===e&&(e={}),n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.apiCall.post("".concat("/operations","/").concat(t),{},e)]}))}))},t}();e.default=o},3620:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(6581)),s=i(n(6067)),u=function(){function t(t,e,n){this.collectionName=t,this.overrideId=e,this.apiCall=n}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(s.default.RESOURCEPATH,"/").concat(this.overrideId)},t}();e.default=u},6067:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(6581)),s=function(){function t(t,e){this.collectionName=t,this.apiCall=e}return t.prototype.upsert=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.apiCall.put(this.endpointPath(t),e)]}))}))},t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.endpointPath=function(e){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return"/overrides"},enumerable:!1,configurable:!0}),t}();e.default=s},1040:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(1036)),s=function(){function t(t,e){this.presetId=t,this.apiCall=e}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.presetId)},t}();e.default=s},1036:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.apiCall=t}return t.prototype.upsert=function(t,e){return n(this,void 0,void 0,(function(){return r(this,(function(n){return[2,this.apiCall.put(this.endpointPath(t),e)]}))}))},t.prototype.retrieve=function(){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.endpointPath=function(e){return"".concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return"/presets"},enumerable:!1,configurable:!0}),t}();e.default=o},2598:function(t,e){"use strict";var n=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.responseCache=new Map,this.responsePromiseCache=new Map}return t.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},t.prototype.perform=function(t,e,i,a){return n(this,void 0,void 0,(function(){var n,s,u,c,l,f,h,p,d,y,v;return r(this,(function(r){switch(r.label){case 0:if(n=a.cacheResponseForSeconds,s=void 0===n?120:n,u=a.maxSize,c=void 0===u?100:u,s<=0||c<=0)return[2,e.call.apply(e,o([t],i,!1))];if(l=JSON.stringify(i),f=this.responseCache.get(l),h=Date.now(),f){if(h-f.requestTimestamp<1e3*s)return this.responseCache.delete(l),this.responseCache.set(l,f),[2,Promise.resolve(f.response)];this.responseCache.delete(l)}if(p=this.responsePromiseCache.get(l)){if(h-p.requestTimestamp<1e3*s)return this.responsePromiseCache.delete(l),this.responsePromiseCache.set(l,p),[2,p.responsePromise];this.responsePromiseCache.delete(l)}return d=e.call.apply(e,o([t],i,!1)),this.responsePromiseCache.set(l,{requestTimestamp:h,responsePromise:d}),[4,d];case 1:return y=r.sent(),this.responseCache.set(l,{requestTimestamp:h,response:y}),this.responseCache.size>c&&(v=this.responseCache.keys().next().value,this.responseCache.delete(v)),this.responsePromiseCache.size>c&&(v=this.responsePromiseCache.keys().next().value,this.responsePromiseCache.delete(v)),[2,y]}}))}))},t}();e.default=i},8834:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(2554)),i=r(n(9777)),a=r(n(9092)),s=n(3320),u=function(){function t(t){var e;t.sendApiKeyAsQueryParam=null===(e=t.sendApiKeyAsQueryParam)||void 0===e||e,!0===t.sendApiKeyAsQueryParam&&(t.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),t.sendApiKeyAsQueryParam=!1),this.configuration=new o.default(t),this.apiCall=new i.default(this.configuration),this.multiSearch=new a.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return t.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach((function(t){t[0],t[1].documents().clearCache()}))},t.prototype.collections=function(t){if(t)return void 0===this.individualCollections[t]&&(this.individualCollections[t]=new s.SearchOnlyCollection(t,this.apiCall,this.configuration)),this.individualCollections[t];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},t}();e.default=u},3320:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchOnlyCollection=void 0;var r=n(5586),o=function(){function t(t,e,n){this.name=t,this.apiCall=e,this.configuration=n,this._documents=new r.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return t.prototype.documents=function(){return this._documents},t}();e.SearchOnlyCollection=o},5586:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SearchOnlyDocuments=void 0;var a=i(n(2598)),s=i(n(6581)),u="/documents",c=function(){function t(t,e,n){this.collectionName=t,this.apiCall=e,this.configuration=n,this.requestWithCache=new a.default}return t.prototype.clearCache=function(){this.requestWithCache.clearCache()},t.prototype.search=function(t,e){var n=void 0===e?{}:e,i=n.cacheSearchResultsForSeconds,a=void 0===i?this.configuration.cacheSearchResultsForSeconds:i,s=n.abortSignal,u=void 0===s?null:s;return r(this,void 0,void 0,(function(){var e,n,r;return o(this,(function(o){for(n in e={},!0===this.configuration.useServerSideSearchCache&&(e.use_cache=!0),t)Array.isArray(t[n])&&(e[n]=t[n].join(","));return r=Object.assign({},t,e),[2,this.requestWithCache.perform(this.apiCall,this.apiCall.get,[this.endpointPath("search"),r,{abortSignal:u}],{cacheResponseForSeconds:a})]}))}))},t.prototype.endpointPath=function(t){return"".concat(s.default.RESOURCEPATH,"/").concat(this.collectionName).concat(u).concat(void 0===t?"":"/"+t)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return u},enumerable:!1,configurable:!0}),t}();e.SearchOnlyDocuments=c},1483:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(6581)),s=i(n(1940)),u=function(){function t(t,e,n){this.collectionName=t,this.synonymId=e,this.apiCall=n}return t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.delete=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.delete(this.endpointPath())]}))}))},t.prototype.endpointPath=function(){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(s.default.RESOURCEPATH,"/").concat(this.synonymId)},t}();e.default=u},1940:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=i(n(6581)),s=function(){function t(t,e){this.collectionName=t,this.apiCall=e}return t.prototype.upsert=function(t,e){return r(this,void 0,void 0,(function(){return o(this,(function(n){return[2,this.apiCall.put(this.endpointPath(t),e)]}))}))},t.prototype.retrieve=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.apiCall.get(this.endpointPath())]}))}))},t.prototype.endpointPath=function(e){return"".concat(a.default.RESOURCEPATH,"/").concat(this.collectionName).concat(t.RESOURCEPATH).concat(void 0===e?"":"/"+e)},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return"/synonyms"},enumerable:!1,configurable:!0}),t}();e.default=s},9964:()=>{},7061:(t,e,n)=>{var r=n(8698).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),s=new j(r||[]);return a(i,"_invoke",{value:O(t,n,s)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d={};function y(){}function v(){}function g(){}var b={};f(b,u,(function(){return this}));var m=Object.getPrototypeOf,_=m&&m(m(R([])));_&&_!==n&&i.call(_,u)&&(b=_);var w=g.prototype=y.prototype=Object.create(b);function P(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,a,s,u){var c=p(t[o],t,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):e.resolve(f).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,u)}))}u(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function O(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function x(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=p(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function R(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=f(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},P(S.prototype),f(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new S(h(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},P(w),f(w,l,"Generator"),f(w,u,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=R,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:R(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},8698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},4687:(t,e,n)=>{var r=n(7061)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{"use strict";function t(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,u,"next",e)}function u(e){t(a,o,i,s,u,"throw",e)}s(void 0)}))}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===i(e)?e:String(e)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,a(r.key),r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}n.d(r,{default:()=>O});var c=n(4687),l=n.n(c),f=function(){function t(){var e,n,r,i,a,s,u,c,l,f,h,p,d,y,v,g,b,m,_=this,w=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.server=w.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=null!==(e=this.server.cacheSearchResultsForSeconds)&&void 0!==e?e:120,this.additionalSearchParameters=null!==(n=w.additionalSearchParameters)&&void 0!==n?n:{},this.additionalSearchParameters.query_by=null!==(r=null!==(i=this.additionalSearchParameters.queryBy)&&void 0!==i?i:this.additionalSearchParameters.query_by)&&void 0!==r?r:"",this.additionalSearchParameters.preset=null!==(a=null!==(s=this.additionalSearchParameters.preset)&&void 0!==s?s:this.additionalSearchParameters.preset)&&void 0!==a?a:"",this.additionalSearchParameters.sort_by=null!==(u=null!==(c=this.additionalSearchParameters.sortBy)&&void 0!==c?c:this.additionalSearchParameters.sort_by)&&void 0!==u?u:"",this.additionalSearchParameters.highlight_full_fields=null!==(l=null!==(f=this.additionalSearchParameters.highlightFullFields)&&void 0!==f?f:this.additionalSearchParameters.highlight_full_fields)&&void 0!==l?l:this.additionalSearchParameters.query_by,this.geoLocationField=null!==(h=w.geoLocationField)&&void 0!==h?h:"_geoloc",this.facetableFieldsWithSpecialCharacters=null!==(p=w.facetableFieldsWithSpecialCharacters)&&void 0!==p?p:[],this.collectionSpecificSearchParameters=null!==(d=w.collectionSpecificSearchParameters)&&void 0!==d?d:{},Object.keys(this.collectionSpecificSearchParameters).forEach((function(t){var e,n,r,o,i,a,s=_.collectionSpecificSearchParameters[t];s.query_by=null!==(e=s.queryBy)&&void 0!==e?e:s.query_by,s.preset=null!==(n=s.preset)&&void 0!==n?n:s.preset,s.sort_by=null!==(r=s.sortBy)&&void 0!==r?r:s.sort_by,s.highlight_full_fields=null!==(o=null!==(i=null!==(a=s.highlightFullFields)&&void 0!==a?a:s.highlight_full_fields)&&void 0!==i?i:_.additionalSearchParameters.highlight_full_fields)&&void 0!==o?o:s.query_by,Object.keys(s).forEach((function(t){return void 0===s[t]?delete s[t]:{}}))})),this.renderingContent=w.renderingContent,this.flattenGroupedHits=null===(y=w.flattenGroupedHits)||void 0===y||y,this.facetByOptions=null!==(v=w.facetByOptions)&&void 0!==v?v:{},this.filterByOptions=null!==(g=w.filterByOptions)&&void 0!==g?g:{},this.collectionSpecificFacetByOptions=null!==(b=w.collectionSpecificFacetByOptions)&&void 0!==b?b:{},this.collectionSpecificFilterByOptions=null!==(m=w.collectionSpecificFilterByOptions)&&void 0!==m?m:{}}return u(t,[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some((function(t){return t.queryBy})))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),0===this.additionalSearchParameters.query_by.length&&0===this.additionalSearchParameters.preset.length&&(0===Object.keys(this.collectionSpecificSearchParameters).length||Object.values(this.collectionSpecificSearchParameters).some((function(t){return 0===(t.query_by||"").length&&0===(t.preset||"").length}))))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}]),t}(),h=n(8871);function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||d(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=function(){function t(e,n,r){o(this,t),this.instantsearchRequests=e,this.typesenseClient=n,this.configuration=r,this.additionalSearchParameters=r.additionalSearchParameters,this.collectionSpecificSearchParameters=r.collectionSpecificSearchParameters}var n;return u(t,[{key:"_shouldUseExactMatchForField",value:function(t,e){var n,r;return!1!==(null===(n=this.configuration.collectionSpecificFilterByOptions)||void 0===n||null===(n=n[e])||void 0===n||null===(n=n[t])||void 0===n?void 0:n.exactMatch)&&!1!==(null===(r=this.configuration.filterByOptions)||void 0===r||null===(r=r[t])||void 0===r?void 0:r.exactMatch)}},{key:"_adaptFacetFilters",value:function(t,e){var n=this,r="";return t?r=t.map((function(t){if(Array.isArray(t)){var r={};t.forEach((function(t){var e=n._parseFacetFilter(t),o=e.fieldName,i=e.fieldValue;r[o]=r[o]||[],r[o].push(i)})),Object.keys(r).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(r).join(",")));var o=Object.keys(r)[0],i=r[o].reduce((function(t,e){return e.startsWith("-")&&!n._isNumber(e)?t[0].push(e.substring(1)):t[1].push(e),t}),[[],[]]),a=y(i,2),s=a[0],u=a[1],c=[];if(u.length>0){var l=n._shouldUseExactMatchForField(o,e)?":=":":";c.push("".concat(o).concat(l,"[").concat(u.map((function(t){return n._escapeFacetValue(t)})).join(","),"]"))}if(s.length>0){var f=n._shouldUseExactMatchForField(o,e)?":!=":":!";c.push("".concat(o).concat(f,"[").concat(s.map((function(t){return n._escapeFacetValue(t)})).join(","),"]"))}return c.filter((function(t){return t})).join(" && ")}var h,p=n._parseFacetFilter(t),d=p.fieldName,v=p.fieldValue;if(v.startsWith("-")&&!n._isNumber(v)){var g=n._shouldUseExactMatchForField(d,e)?":!=":":!";h="".concat(d).concat(g,"[").concat(n._escapeFacetValue(v.substring(1)),"]")}else{var b=n._shouldUseExactMatchForField(d,e)?":=":":";h="".concat(d).concat(b,"[").concat(n._escapeFacetValue(v),"]")}return h})).join(" && "):r}},{key:"_parseFacetFilter",value:function(t){var e,n,r,o,i;if((null===(e=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===e?void 0:e.length)>0){var a=this.configuration.facetableFieldsWithSpecialCharacters.flat().map((function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(a.join("|"),"):(.*)$")),null!=(r=t.match(n)))return{fieldName:o="".concat(r[1]),fieldValue:i="".concat(r[2])}}return n=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,null==(r=t.match(n))?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(t,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(o="".concat(r[1]).concat(r[2]),i="".concat(r[3])),{fieldName:o,fieldValue:i}}},{key:"_escapeFacetValue",value:function(t){return"boolean"==typeof t||"true"===t||"false"===t||this._isNumber(t)?t:"`".concat(t,"`")}},{key:"_isNumber",value:function(t){return Number.isInteger(t%1)||!!(t%1)}},{key:"_adaptNumericFilters",value:function(t){var e=this,n="";if(!t)return n;var r={};t.forEach((function(t){var n=e._parseNumericFilter(t),o=n.fieldName,i=n.operator,a=n.fieldValue;r[o]=r[o]||{},r[o][i]=a}));var o=[];return Object.keys(r).forEach((function(t){null!=r[t]["<="]&&null!=r[t][">="]?o.push("".concat(t,":=[").concat(r[t][">="],"..").concat(r[t]["<="],"]")):null!=r[t]["<="]?o.push("".concat(t,":<=").concat(r[t]["<="])):null!=r[t][">="]?o.push("".concat(t,":>=").concat(r[t][">="])):null!=r[t]["="]?o.push("".concat(t,":=").concat(r[t]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(r[t])))})),o.join(" && ")}},{key:"_parseNumericFilter",value:function(t){var e,n,r,o,i,a;if((null===(e=this.configuration.facetableFieldsWithSpecialCharacters)||void 0===e?void 0:e.length)>0){var s=this.configuration.facetableFieldsWithSpecialCharacters.map((function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}));if(n=new RegExp("^(".concat(s.join("|"),")(<=|>=|>|<|=)(.*)$")),null!=(r=t.match(n))){var u=y(r,4);return{fieldName:o=u[1],operator:i=u[2],fieldValue:a=u[3]}}}if(n=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,null==(r=t.match(n)))console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(t,"` with the Regex `").concat(n,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var c=y(r,4);o=c[1],i=c[2],a=c[3]}return{fieldName:o,operator:i,fieldValue:a}}},{key:"_adaptGeoFilter",value:function(t){var e=t.insideBoundingBox,n=t.aroundRadius,r=t.aroundLatLng,o=t.insidePolygon;if(e){var i,a,s,u;if(Array.isArray(e)){var c=y(e.flat(),4);i=c[0],a=c[1],s=c[2],u=c[3]}else{var l=y(e.split(","),4);i=l[0],a=l[1],s=l[2],u=l[3]}return"".concat(this.configuration.geoLocationField,":(").concat(i,", ").concat(a,", ").concat(i,", ").concat(u,", ").concat(s,", ").concat(u,", ").concat(s,", ").concat(a,")")}if(r||n){if(!n||"all"===n)throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var f="".concat(parseFloat(n)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(r,", ").concat(f,")")}if(o){var h=o;return Array.isArray(o)&&(h=o.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(h,")")}}},{key:"_adaptFilters",value:function(t,e){var n=[];return t.filters&&n.push(t.filters),n.push(this._adaptFacetFilters(t.facetFilters,e)),n.push(this._adaptNumericFilters(t.numericFilters)),n.push(this._adaptGeoFilter(t)),n.filter((function(t){return t&&""!==t})).join(" && ")}},{key:"_adaptIndexName",value:function(t){return t.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(t){return t.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(t,e){var n=this;return[t].flat().map((function(t){var r;return null!==(r=n.configuration.collectionSpecificFacetByOptions)&&void 0!==r&&null!==(r=r[e])&&void 0!==r&&r[t]?"".concat(t).concat(n.configuration.collectionSpecificFacetByOptions[e][t]):n.configuration.facetByOptions[t]?"".concat(t).concat(n.configuration.facetByOptions[t]):t})).join(",")}},{key:"_buildSearchParameters",value:function(t){for(var e=t.params,n=t.indexName,r=this._adaptIndexName(n),o={},i=0,a=Object.entries(this.additionalSearchParameters);i<a.length;i++){var s=y(a[i],2),u=s[0],c=s[1];o[this._camelToSnakeCase(u)]=c}if(this.collectionSpecificSearchParameters[r])for(var l=0,f=Object.entries(this.collectionSpecificSearchParameters[r]);l<f.length;l++){var h=y(f[l],2),p=h[0],d=h[1];o[this._camelToSnakeCase(p)]=d}var v=Object.assign({},o),g=this._adaptSortBy(n);return Object.assign(v,{collection:r,q:""===e.query||void 0===e.query?"*":e.query,facet_by:o.facet_by||this._adaptFacetBy(e.facets,r),filter_by:this._adaptFilters(e,r)||o.filter_by,sort_by:g||o.sort_by,max_facet_values:e.maxValuesPerFacet,page:(e.page||0)+1}),e.hitsPerPage&&(v.per_page=e.hitsPerPage),e.facetQuery&&(v.facet_query="".concat(e.facetName,":").concat(e.facetQuery),v.per_page=0),e.typesenseVectorQuery&&(v.vector_query=e.typesenseVectorQuery),Object.fromEntries(Object.entries(v).filter((function(t){var e=y(t,2),n=(e[0],e[1]);return null!=n&&""!==n})))}},{key:"_camelToSnakeCase",value:function(t){return t.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(n=e(l().mark((function t(){var e,n=this;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.instantsearchRequests.map((function(t){return n._buildSearchParameters(t)})),t.abrupt("return",this.typesenseClient.multiSearch.perform({searches:e}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}]),t}();function g(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||d(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e,n){return(e=a(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m={_adaptHighlightTag:function(t,e,n){return t.replace(new RegExp("<mark>","g"),e||"<mark>").replace(new RegExp("</mark>","g"),n||"</mark>")},_adaptNumberOfPages:function(){var t=this.typesenseResponse.found/this.typesenseResponse.request_params.per_page;return Number.isFinite(t)?Math.ceil(t):1}};function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var P=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];o(this,t),this.typesenseResponse=e,this.instantsearchRequest=n,this.configuration=r,this.allTypesenseResponses=i}return u(t,[{key:"_adaptGroupedHits",value:function(t){var e=this,n=[];return n=t.map((function(t){var n=e._adaptHits(t.hits);return n.forEach((function(e){e.group_key=e._group_key=t.group_key,t.found&&(e._group_found=t.found)})),n})),this.configuration.flattenGroupedHits?n.flat():n.map((function(t){return w(w({},t[0]),{},{_grouped_hits:t})}))}},{key:"_adaptHits",value:function(t){var e=this;return t.map((function(t){var n=w({},t.document);n.objectID=t.document.id,n._snippetResult=e._adaptHighlightResult(t,"snippet"),n._highlightResult=e._adaptHighlightResult(t,"value"),n._rawTypesenseHit=t,["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance"].forEach((function(e){Object.keys(t).includes(e)&&!Object.keys(n).includes(e)&&(n[e]=t[e])}));var r=n[e.configuration.geoLocationField];return r&&(n._geoloc={lat:r[0],lng:r[1]}),n}))}},{key:"_adaptHighlightResult",value:function(t,e){var n={};return null!=t.highlight&&this.isHighlightPost0240RCN32Format(t.highlight)?this.adaptHighlightObject(t,n,e):this.adaptHighlightsArray(t,n,e),n}},{key:"isHighlightPost0240RCN32Format",value:function(t){return null==t.full&&null==t.snippet}},{key:"adaptHighlightsArray",value:function(t,e,n){var r=this;Object.assign.apply(Object,[e].concat(g(Object.entries(t.document).map((function(t){var e=y(t,2);return b({},e[0],{value:e[1],matchLevel:"none",matchedWords:[]})}))))),t.highlights.forEach((function(t){e[t.field]={value:t[n]||t["".concat(n,"s")],matchLevel:"full",matchedWords:t.matched_tokens},t.indices&&(e[t.field].matchedIndices=t.indices)})),Object.entries(e).forEach((function(o){var a=y(o,2),s=a[0],u=a[1],c=s,l=u.value,f=u.matchLevel,h=u.matchedWords,p=u.matchedIndices;null==l?e[c]=r._adaptHighlightNullValue():Array.isArray(l)?(e[c]=[],t.document[c].forEach((function(t,o){p&&p.includes(o)?e[c].push({value:r._adaptHighlightTag("".concat(l[p.indexOf(o)]),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag),matchLevel:f,matchedWords:h[o]}):"object"===i(t)?e[c].push(r._adaptHighlightInObjectValue(t,{},n)):e[c].push({value:"".concat(t),matchLevel:"none",matchedWords:[]})}))):"object"===i(l)?e[c]=r._adaptHighlightInObjectValue(l,{},n):e[c].value=r._adaptHighlightTag("".concat(l),r.instantsearchRequest.params.highlightPreTag,r.instantsearchRequest.params.highlightPostTag)}))}},{key:"adaptHighlightObject",value:function(t,e,n){Object.assign(e,this._adaptHighlightInObjectValue(t.document,t.highlight,n))}},{key:"_adaptHighlightInObjectValue",value:function(t,e,n){var r=this;return Object.assign.apply(Object,[{}].concat(g(Object.entries(t).map((function(t){var o,a=y(t,2),s=a[0],u=a[1];if(null==u)o=r._adaptHighlightNullValue();else if(Array.isArray(u)){var c;o=r._adaptHighlightInArrayValue(u,null!==(c=null==e?void 0:e[s])&&void 0!==c?c:[],n)}else if("object"===i(u)){var l;o=r._adaptHighlightInObjectValue(u,null!==(l=null==e?void 0:e[s])&&void 0!==l?l:{},n)}else o=r._adaptHighlightInPrimitiveValue(u,null==e?void 0:e[s],n);return b({},s,o)})))))}},{key:"_adaptHighlightInArrayValue",value:function(t,e,n){var r=this;return t.map((function(t,o){var a;if(null==t)a=r._adaptHighlightNullValue();else if(Array.isArray(t)){var s;a=r._adaptHighlightInArrayValue(t,null!==(s=null==e?void 0:e[o])&&void 0!==s?s:[],n)}else if("object"===i(t)){var u;a=r._adaptHighlightInObjectValue(t,null!==(u=null==e?void 0:e[o])&&void 0!==u?u:{},n)}else a=r._adaptHighlightInPrimitiveValue(t,null==e?void 0:e[o],n);return a}))}},{key:"_adaptHighlightInPrimitiveValue",value:function(t,e,n){var r,o;return null!=e?{value:this._adaptHighlightTag("".concat(null!==(r=null!==(o=e[n])&&void 0!==o?o:e.highlight)&&void 0!==r?r:e.snippet),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(e.matched_tokens||[]).length>0?"full":"none",matchedWords:e.matched_tokens||[]}:{value:this._adaptHighlightTag("".concat(t),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(t){var e={};return t.forEach((function(t){Object.assign(e,b({},t.field_name,Object.assign.apply(Object,[{}].concat(g(t.counts.map((function(t){return b({},t.value,t.count)})))))))})),e}},{key:"_adaptFacetStats",value:function(t){var e={};return t.forEach((function(t){Object.keys(t.stats).length>0&&Object.assign(e,b({},t.field_name,t.stats))})),e}},{key:"_adaptRenderingContent",value:function(t){var e,n=Object.assign({},this.configuration.renderingContent);return null==(null===(e=n.facetOrdering)||void 0===e||null===(e=e.facets)||void 0===e?void 0:e.order)&&(n.facetOrdering=n.facetOrdering||{},n.facetOrdering.facets=n.facetOrdering.facets||{},n.facetOrdering.facets.order=g(new Set(t.map((function(t){return t.field_name})).concat(this.allTypesenseResponses.map((function(t){return t.facet_counts||[]})).flat().map((function(t){return t.field_name})).filter((function(t){return t})))))),n}},{key:"adapt",value:function(){var t=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]);return w({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:this.typesenseResponse.request_params.per_page,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||{}),query:this.typesenseResponse.request_params.q,processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(t).length>0?{renderingContent:t}:null)}}]),t}();Object.assign(P.prototype,m);var S=function(){function t(e,n){o(this,t),this.typesenseResponse=e,this.instantsearchRequest=n}return u(t,[{key:"_adaptFacetHits",value:function(t){var e=this;return t.find((function(t){return t.field_name===e.instantsearchRequest.params.facetName})).counts.map((function(t){return{value:t.value,highlighted:e._adaptHighlightTag(t.highlighted,e.instantsearchRequest.params.highlightPreTag,e.instantsearchRequest.params.highlightPostTag),count:t.count}}))}},{key:"adapt",value:function(){return{facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms}}}]),t}();Object.assign(S.prototype,m);var O=function(){function t(e){var n=this;o(this,t),this.updateConfiguration(e),this.searchClient={clearCache:function(){return n.clearCache()},search:function(t){return n.searchTypesenseAndAdapt(t)},searchForFacetValues:function(t){return n.searchTypesenseForFacetValuesAndAdapt(t)}}}var n,r,i;return u(t,[{key:"searchTypesenseAndAdapt",value:(i=e(l().mark((function t(e){var n,r,o=this;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._adaptAndPerformTypesenseRequest(e);case 3:return n=t.sent,r=n.results.map((function(t,r){return o._validateTypesenseResult(t),new P(t,e[r],o.configuration,n.results).adapt()})),t.abrupt("return",{results:r});case 8:throw t.prev=8,t.t0=t.catch(0),console.error(t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return i.apply(this,arguments)})},{key:"searchTypesenseForFacetValuesAndAdapt",value:(r=e(l().mark((function t(e){var n,r,o=this;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._adaptAndPerformTypesenseRequest(e);case 3:return n=t.sent,r=n.results.map((function(t,n){return o._validateTypesenseResult(t),new S(t,e[n],o.configuration).adapt()})),t.abrupt("return",r);case 8:throw t.prev=8,t.t0=t.catch(0),console.error(t.t0),t.t0;case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return r.apply(this,arguments)})},{key:"_adaptAndPerformTypesenseRequest",value:(n=e(l().mark((function t(e){var n,r;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=new v(e,this.typesenseClient,this.configuration),t.next=3,n.request();case 3:return r=t.sent,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"clearCache",value:function(){return this.typesenseClient=new h.SearchClient(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(t){return this.configuration=new f(t),this.configuration.validate(),this.typesenseClient=new h.SearchClient(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(t){if(t.error)throw new Error("".concat(t.code," - ").concat(t.error));if(!t.hits&&!t.grouped_hits)throw new Error("Did not find any hits. ".concat(t.code," - ").concat(t.error))}}]),t}()})(),r.default})()));
//# sourceMappingURL=typesense-instantsearch-adapter.min.js.map